<template>
  <div class="login-panel">
    <!-- logo区域 -->
    <div class="title">
      <h1>后台管理系统</h1>
    </div>
    <!-- 登录框区域 -->
    <el-tabs type="border-card" :stretch="true" v-model="currentTab">
      <el-tab-pane name="account">
        <template #label>
          <span><i class="el-icon-user"></i> 账号登录</span>
        </template>
        <!-- 账号登录组件 -->
        <login-account ref="accountRef"></login-account>
      </el-tab-pane>
      <el-tab-pane name="phone">
        <template #label>
          <span><i class="el-icon-mobile-phone"></i> 手机登录</span>
        </template>
        <!-- 手机号登录组件 -->
        <login-phone ref="phoneRef"></login-phone>
      </el-tab-pane>
    </el-tabs>
    <!-- 忘记密码区域 -->
    <div class="account-config">
      <el-checkbox v-model="isKeepPassword">记住密码</el-checkbox>
      <el-link type="primary">忘记密码</el-link>
    </div>
    <!-- 注册用户区域 -->
    <div class="account-register">
      <el-link type="info" @click="handleRegisterClick">注册新用户</el-link>
    </div>
    <!-- 确认登录区域 -->
    <el-button type="primary" class="login-confirm" @click="handleLoginClick"
      >确认登录</el-button
    >
  </div>
</template>

<script>
export default {
  data() {
    return {}
  },
  components: {},
  methods: {
    handleRegisterClick() {
      this.$router.push('/register')
    }
  }
}
</script>

<style lang="less" scoped>
.login-panel {
  width: 320px;
  margin-bottom: 150px;
  .title {
    text-align: center;
  }
  .account-config {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
  }
  .account-register {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
  }
  .login-confirm {
    margin-top: 10px;
    width: 100%;
  }
}
</style>
